import requests from '../request';

/*
* export const test=()=>{
*   return requests({url:'',method:''})
* }*/

//登录
export const login=(userInfo)=>{
    return requests({url:'/login',method:'post',data:userInfo})
}

export const test=(id)=>{
    return requests({url:`/getUserInfo/${id}`,method:'get'})
}

export const saveUser=(userInfo)=>{
    return requests({url:`/getUserInfoByName`,method:'post',data:userInfo})
}

export const getUserInfo=(name)=>{
    return requests({url:`/getUserInfo/${name}`,method:'get'})
}
//更新登录时间
export const updateLoginTime=(id)=>{
    return requests({url:`/updateloginTime/${id}`,method:'post'})
}

//注册
//验证用户名是否存在
export const userNameExist=(name)=>{
    return requests({url:`/userNameExist/${name}`,method:'get'})
}
//注册用户
export const registerUser=(userInfo)=>{
    return requests({url:'/register',method:'post',data:userInfo})
}
